{% extends 'df_goods/base.html' %}
{% load static %}
{% block title1 %}商品搜索结果{% endblock title1 %}
{% block detail3  %}
<div class="search_bar clearfix">
    <div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;商品搜索</div>
    <div class="search_con fr">
            <form method="get" action="/search">
            <input type="text" class="input_text fl" name="q" placeholder="搜索商品">
            <input type="submit" class="input_btn fr" name="" value="搜索" >
            </form>
        </div>
{% endblock detail3  %}

{% block detail2  %}

<div class="breadcrumb">
    <a href="#">{{ query }}</a>
    <span>></span>
    <a href="#">搜索结果</a>
</div>
	<div class="main_wrap clearfix">
        <ul class="goods_type_list clearfix">
                {% for item in page %}
				<li>
					<a href="{% url 'goods:detail' item.object.id %}"><img src="{{STATIC_URL}}{{ item.object.gpic }}"></a>
					<h4><a href="{% url 'goods:detail' item.object.id %}">{{ item.object.gtitle }}</a></h4>
					<div class="operate">
						<span class="prize">￥{{ item.object.gprice }}</span>
						<span class="unit">{{ item.object.gprice }}元/500g</span>
						<a href="#" class="add_goods" title="加入购物车"></a>
					</div>
				</li>
			 {% empty %}
			未搜索到结果
                {% endfor %}
			</ul>
        <div class="pagenation">
                {% if page.has_previous %}
				<a href="/search?q={{ query }}&page={{ page.previous_page_number }}">上一页</a>
                {% endif %}
                {% for pindex in paginator.page_range %}
                    {% if pindex == page.number %}
				        <a href="/search?q={{ query }}&page={{ pindex }}" class="active">{{ pindex }}</a>
                    {% else %}
				        <a href="/search?q={{ query }}&page={{ pindex }}">{{ pindex }}</a>
                    {% endif %}
                {% endfor %}
                {% if page.has_next %}
				<a href="/search?q={{ query }}&page={{ page.next_page_number }}">下一页</a>
                {% endif %}
			</div>
	</div>
{% endblock detail2  %}